﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;

namespace Tsanie.ShellExtension.Util {
    public class NativeMethods {
        [DllImport("user32.dll", CharSet = CharSet.Auto, ExactSpelling = true, CallingConvention = CallingConvention.Winapi)]
        public static extern short GetKeyState(int keyCode);

        public const int VK_CONTROL = 0x11;

        public static bool IsKeyDown(int keyCode) {
            return ((GetKeyState(keyCode) & 0x80) == 0x80);
        }
    }
}
